package xyz.yeidi.utils;

import xyz.yeidi.controller.LoginServlet;
import xyz.yeidi.dao.api.OrderDetailDao;
import xyz.yeidi.service.api.*;
import xyz.yeidi.service.impl.*;

/**
 * @Author JIP
 * @Date 2021-08-06 12:20
 * @Version 1.0
 * @Describe :  单例工厂
 */
public class ServiceFactory {
    private static final UserService USER_SERVICE= new UserServiceImpl();
    private static final BusinessService BUSINESS_SERVICE = new BusinessServiceImpl();
    private static final DeliveryAddressService DELIVERY_ADDRESS_SERVICE = new DeliveryAddressServiceImpl();
    private static final FoodService FOOD_SERVICE = new FoodServiceImpl();
    private static final OrdersService ORDERS_SERVICE = new OrdersServiceImpl();
    private static final OrderDetailService ORDER_DETAIL_SERVICE = new OrderDetailServiceImpl();
    public static UserService getUserService(){
        return USER_SERVICE;
    }

    public static BusinessService getBusinessService(){
        return BUSINESS_SERVICE;
    }

    public static DeliveryAddressService getDeliveryAddressService(){
        return DELIVERY_ADDRESS_SERVICE;
    }

    public static FoodService getFoodService(){
        return FOOD_SERVICE;
    }

    public static OrdersService getOrdersService(){
        return ORDERS_SERVICE;
    }
    public static OrderDetailService getOrderDetailService(){
        return ORDER_DETAIL_SERVICE;
    }
}
